﻿<UserControl x:Class="SilverlightDemos.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sparrow="http://sparrowtoolkit.codeplex.com/silverlight"
    xmlns:local="clr-namespace:SilverlightDemos" xmlns:demos="clr-namespace:Sparrow.Chart.Demos"
    mc:Ignorable="d" FontFamily="Segeo UI"
    d:DesignHeight="300" d:DesignWidth="400">
    <Grid Background="#FFEFEFEF">
        <Grid.DataContext>
            <demos:DemoViewModel></demos:DemoViewModel>
        </Grid.DataContext>
        <Grid.Resources>
            <demos:SampleToContentConverter x:Key="sampleToContentConverter"/>
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <ListBox Background="#FFEFEFEF" x:Name="demos" ScrollViewer.VerticalScrollBarVisibility="Auto" ItemContainerStyle="{StaticResource ItemContainerStyle}" VerticalContentAlignment="Center"  
                          BorderThickness="0"                                                   
                          ItemsSource="{Binding Samples}" SelectedItem="{Binding Samples[0]}"
                          Margin="5,10" >

        </ListBox>
        
        <Grid Grid.Column="1">
            <ScrollViewer x:Name="contentArea" Content="{Binding ElementName=demos,Path=SelectedItem,Converter={StaticResource sampleToContentConverter}}" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" >
            </ScrollViewer>
        </Grid>
    </Grid> 
</UserControl>